<?php
/**
 * Created by PhpStorm.
 * User: Dave
 * Date: 2018/8/22
 * Time: 15:20
 */

ini_set('display_errors', 1);
error_reporting(-1);
require_once '/data/wwwroot/g_vendor/autoload.php';

use Biz\model\smallenergy\SmallEnergyMessage as mSmallEnergyMessage;
use Doraemon\cache\MsgCounter;

$data = mSmallEnergyMessage::getUnreadCount();

foreach ($data as $value)
{
    $list[$value['to_uid']][] = $value['to_uid'];
}

foreach ($list as $uid => $val)
{
    if($uid) {
        MsgCounter::addMsgNum($uid, MsgCounter::TYPE_CUSTOMER_SERVICE, count($val));
    }
}